package engine;

import java.awt.Point;

import java.util.List;
import java.util.ArrayList;

import resources.manager.ResourceManager;

/**
 * Represents a level.
 */
public class Level
{
	private static final String DELIMETER = ",";
	private ResourceManager myManager = ResourceManager.getInstance();
    private int myFishCount;
    private ArrayList<Point> myPoints;
    private double mySpawnx, mySpawny;
    private int myNumberOfPoints;

    
    public Level(String level){
    	System.out.println(level);
    	myPoints = new ArrayList<Point>();
    	myManager.addResourcesFromFile(level);
    	myFishCount = myManager.getInteger("fish_to_save");
    	mySpawnx = myManager.getDouble("path_inc_x");
    	mySpawny = myManager.getDouble("path_inc_y");
    	myNumberOfPoints = myManager.getInteger("num_path_points");
    	String[] temp = myManager.getStringArray("points", DELIMETER);
    	for(int i=0; i<temp.length-1; i=i+2){
    		myPoints.add(new Point(Integer.parseInt(temp[i]), Integer.parseInt(temp[i+1])));
    	}
    	
    	
    	
    }
    
    
    
    protected ArrayList<Point> getPoints(){
    	return myPoints;
    }
    
    private void fillList(String[] temp){
    	
    	
    	
    }

}
